<?php
/*
  The caller of this scripts should have MYSQL's session variable set up beforehand.
 */
if($_POST) {
  session_start();
  mysql_connect('localhost', $_SESSION['dbuser'], $_SESSION['dbpwd']);
  mysql_select_db($_SESSION['dbname']);
  mysql_query("set names 'utf8'");

  $sql = $_POST['sql'];
  header ('Content-type: text/html; charset=utf-8');
  //$succ = 1;
  $succ = mysql_query($sql);
  
  if (!$succ) {
    echo "fail, ($sql), 数据库失败了:" . mysql_error();
    echo sprintf("<br />%s@%s:%s", $_SESSION['dbuser'], $_SESSION['dbname'], $_SESSION['dbpwd']);
  } else {
    echo 'mysql更新成功了' . mysql_affected_rows() . '行';
  }
} else {
  echo "I'm getting a GET request, should be POST";
}
?>
insert into sina_user(email,passwd,categories,enabled,victim_keywords,sources) values ("ewow123@sina.com","hupozhanchi","减肥秘籍","1","美容美发#宅#服饰#香水#女性健康#瘦身#减肥#健康#瑜伽#冷笑话#精油#护肤#情感#韩剧#旅游#度假#吃喝#星座","body.5200tv.com.1313034614#body.5200tv.com.1313035533") on duplicate key update email = "ewow123@sina.com",passwd = "hupozhanchi",categories = "减肥秘籍",enabled ="1",victim_keywords = "美容美发#宅#服饰#香水#女性健康#瘦身#减肥#健康#瑜伽#冷笑话#精油#护肤#情感#韩剧#旅游#度假#吃喝#星座",sources ="body.5200tv.com.1313034614#body.5200tv.com.1313035533";


insert into sina_user(email,passwd,categories,enabled,victim_keywords,sources) values ("ewow123@sina.com","hupozhanchi","减肥秘籍","1","美容美发#宅#服饰#香水#女性健康#瘦身#减肥#健康#瑜伽#冷笑话#精油#护肤#情感#韩剧#旅游#度假#吃喝#星座","body.5200tv.com.1313034614#body.5200tv.com.1313035533");